package com.itheima.exer.homework.hw1007.hwtest;

import java.text.Collator;
import java.util.*;

public class ListDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("cab");
        list.add("bac");
        list.add("acb");
        list.add("cba");
        list.add("bca");
        list.add("abc");
        Collections.sort(list, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                Collator collator = Collator.getInstance(Locale.CHINA);
                int compare = collator.compare(o1, o2);
                return compare;
            }
        });
        System.out.println(list);
    }
}
